package org.jeecg.modules.wo.people.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.common.util.DateUtils;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

/**
 * @Description: 人员管理
 * @Author: jeecg-boot
 * @Date:   2022-03-22
 * @Version: V1.0
 */
@Data
@TableName("wo_people")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="wo_people对象", description="人员管理")
public class WoPeople4Show extends WoPeople {
    private String dayTimes;
    private int day;
    public WoPeople4Show(){

    }
    public WoPeople4Show(WoPeople psn){
        BeanUtils.copyProperties(psn, this);
        if(psn.getNucleicDate()!=null){
            Calendar calSrc = Calendar.getInstance();
            calSrc.setTime(psn.getNucleicDate());
            this.setDay(DateUtils.dateDiff('d', Calendar.getInstance(), calSrc));
            this.setDayTimes(DateUtils.addTime(psn.getNucleicDate(),new Date()));
        }
    }
}
